package com.easilyj.service.impl;

import com.easilyj.bean.Article;
import com.easilyj.bean.ArticleCategory;
import com.easilyj.dao.ArticleCategoryDao;
import com.easilyj.service.ArticleCategoryService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@CacheConfig(cacheNames = "articleCategory")
public class ArticleCategoryServiceImpl implements ArticleCategoryService {

    @Resource
    private ArticleCategoryDao articleCategoryDao;

    @Override
    public void deleteById(Long id) {
        articleCategoryDao.deleteById(id);
    }

    @Override
    public ArticleCategory save(ArticleCategory ac) {
        return articleCategoryDao.save(ac);
    }

    @Override
    public ArticleCategory getOne(Long id) {
        return articleCategoryDao.getOne(id);
    }

    @Override
    public List<ArticleCategory> findAll() {
        return articleCategoryDao.findAll();
    }

}
